<ul class="xsy_contact_refer">
{{each data.entitys as entity i}}
    <li data-rid="{{entity.id}}" oppContactId={{entity.oppContactId}} class="xsy_su_refer_card_item">
         <div class="xsy_su_refer_card_itembody">
            <h2 class="xsy_su_refer_card_field">
                 <div class="xsy_su_refer_card_title">
                    {{if entity.permissions && entity.permissions.view === false}}
                        <a href="javascript:$.msg('无权限查看详情');" class="xsy_su_refer_card_link">{{entity.name}}</a>
                    {{else}}
                        <a target="_blank" href="{{ownerConfig.linkOfFinal | templateText: entity}}" class="xsy_su_refer_card_link">{{entity.name}}</a>
                    {{/if}}
                    
                    {{if entity && entity.mainFlg}}
                        <span class="xsy_contact_refer_sta" title="主要联系人"></span>
                    {{/if}}
                    <div class="xsy_contact_refer_selectmunu">
                        <div class="xsy_contact_refer_staselect" title="{{entity.contactRoleName}}" value="{{entity.contactRoleId}}" contactId="{{entity.id}}" oppContactId="{{entity.oppContactId}}">
                            {{if entity.contactRoleName}}
                            <span>{{entity.contactRoleName}}</span>
                            {{else}}
                            <span>请选择角色</span>
                            {{/if}}
                            <i class="arrow"></i>
                        </div>
                    </div>

                 </div>
                 {{if ownerConfig.showEntityMenu}}
                     {{if entity.permissions && entity.permissions._showmenu !== false}}
                     <div class="xsy_su_refer_card_toolbar" act="xsy_refer_card_menu">
                         <a href="javascript:;"><i class="xsy_su_refer_arrow"></i></a>
                     </div>
                     {{/if}}
                 {{/if}}
            </h2>
            <ul class="xsy_su_refer_card_rows">
                {{each entity.items as item i}}
                    {{if item.name != 'contactRoleId'}}
                    <li class="xsy_su_refer_card_rows" data-id="{{item.id}}">
                        <div class="xsy_su_refer_card_recorditem">
                            <div class="xsy_su_refer_card_label ellipsis" title="{{item.title}}">{{item.title}}：</div>
                            <div class="xsy_su_refer_card_value ellipsis" title="{{if item.icon != '' }}{{item.icon}}{{else}}{{#item.formatText}}{{/if}}">{{#item.formatText}}</div>
                        </div>
                    </li>
                    {{/if}}
                {{/each}}
            </ul>
         </div>
    </li>
{{/each}}
</ul>